import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    alias: {
      '@': '/src',  // 这意味着 '@' 现在指向 'src' 目录
      '@hooks': '/src/hooks',
      '@images': '/src/images'
    }
  },
  plugins: [react()],
  server: {
    proxy: {
      // '/api': {
      //   target: 'https://api.heziah.top/',
      //   changeOrigin: true,
      //   rewrite: (path) => path.replace(/^\/api/, '')
      // }
      '/api': {
        target: 'http://localhost:8000',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      }
    }
  }
})
